/*
 * Set the page number when click search button
 */
function searchInit(){
    get2('listForm','currPage').selectedIndex = 0;
}
/*
 * check the box. 
 * @param c select or not
 */
function selectOne(me){
    var al = get('chxAll');
    var ac = true;
    var count = parseInt(get('rowCount').value);

    for(var i = 0; i < count; ++i){
       var box = get('listForm:table:' + i + ':deleteids');
       
       for(var j = 0; j < box.length ; ++j) {
		   if(box[j].checked != null){
			  if(!box[j].disabled)
        		  ac = ac && box[j].checked;
		   }
       }    
        al.checked = ac;              
    }    
}
/*
 * check all the box. 
 * @param c select or not
 */
function selectAll(b){
    var c = parseInt(get('rowCount').value);
    
    for(var i = 0; i < c ;++i){
       var box = get('listForm:table:' + i + ':deleteids');
       for(var j = 0; j < box.length ; ++j) 
         if(box[j].checked != null)
	       box[j].checked = b && (!box[j].disabled) ;         
    }
}
/**
 * Confirm to delete
 * @param me The delete button
 */
function confirmDelete(me){
    var b = window.confirm('Are you confirm to delete?');
   
    if (b == true) {
        me.click();
        return true;
    }  
    
    return false;
}